import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        System.out.println("----------圆形工具类测试----------");
        printCirleInfo();
    }
    public static void printCirleInfo() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("1.圆形");
        System.out.println("2.扇形");
        System.out.println("3.圆柱");
        System.out.println("4.圆锥");
        while (true) {
            System.out.print("请选择需要获取相关数据的图形（输入0退出程序）:");
            int optin = scanner.nextInt();
            switch(optin){
                case 1 :
                    System.out.println("请输入圆形半径:");
                    double radius = scanner.nextDouble();
                    Main GeometryUtils;
                    System.out.println("圆形面积：" +
                            Main.getArea(radius));
                    System.out.println("圆形周长：" +
                            Main.getCircumference(radius));
                    break;
                case 2 :
                    System.out.println("请输入圆的半径和扇形圆心角:");
                    radius = scanner.nextDouble();
                    double angle = scanner.nextDouble();
                    System.out.println("扇形弧长为:" +
                            Main.getArcLength(radius,angle));
                    System.out.println("扇形面积为:" +
                            Main.getSectorArea(radius,angle));
                    break;
                case 3 :
                    System.out.println("请输入圆柱的半径和高:");
                    radius = scanner.nextDouble();
                    double height = scanner.nextDouble();
                    System.out.println("圆柱表面积为:" +
                            Main.getCylinderArea(radius,height));
                    System.out.println("圆柱体积为:" +
                            Main.getCylinderVolume(radius,height));
                    break;
                case 4 :
                    System.out.println("请输入圆锥的半径和高:");
                    radius = scanner.nextDouble();
                    height = scanner.nextDouble();
                    System.out.println("圆锥表面积为:" +
                            Main.getConeArea(radius,height));
                    System.out.println("圆锥体积为:" +
                            Main.getConeVolume(radius,height));
                    break;
                case 0 :
                    System.out.println("退出程序。。。");
                    scanner.close();
                    System.exit(0);
                    break;
            }
        }
    }
}
